﻿<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <link rel="Shortcut Icon" href="../../../Content/aecc.ico" type="image/x-icon" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="../../../Content/element-plus/index.css">
  <link rel="stylesheet" href="../../../Content/nprogress/nprogress.min.css">
  <link rel="stylesheet" href="../../../styles/vue-page-common.css">
  <script src="../../../Scripts/Array.prototype.flat.js"></script>
  <script src="../../../Scripts/ResizeObserver.js"></script>
  <script src="../../../Content/vue3/vue.global.js"></script>
  <script src="../../../Content/element-plus/index.full.min.js"></script>
  <script src="../../../Content/element-plus/icons-vue.js"></script>
  <script src="../../../Content/element-plus/zh-cn.min.js"></script>
  <script src="../../../Scripts/axios.min.js"></script>
  <script src="../../../Content/nprogress/nprogress.min.js"></script>
  <script src="../../../Scripts/dayjs.min.js"></script>
  <script src="../../../Scripts/axios.config.js"></script>
  <script src="../../../Scripts/crypto-js.min.js"></script>
  <script src="../../../Scripts/secret.js"></script>
  <title>装配生产报工</title>
  <style>
    .header {
      color: #fff;
      height: 50px;
      display: flex;
      align-items: center;
      background-image: linear-gradient(to right, #1E9FFF 0%, #68e0cf 100%);
    }

    .el-form-item__label {
      font-weight: normal;
    }

    .header-text {
      font-size: 22px;
      margin-left: 10px;
      font-weight: bold;
    }

    .el-breadcrumb__inner,
    .el-breadcrumb__separator {
      font-size: 16px;
      color: #fff !important;
    }

    .card-header-icon {
      color: #1E9FFF;
      margin-right: 5px;
      font-size: 20px;
    }

    .card-header-text {
      color: #000;
      font-size: 20px;
      font-weight: bold;
    }

    .flush-btn {
      position: absolute;
      right: 0;
      top: 0;
    }

    .el-card__body,
    .el-main {
      padding: 2px;
    }

    .el-submenu__title {
      font-size: 16px;
      font-weight: bold;
    }

    .el-sub-menu__title {
      font-size: 20px;
      color: #1E9FFF;
      font-weight: bold;
    }

    .info-text {
      font-size: 16px;
      height: 36px;
      line-height: 36px;
      margin-left: 10px;
    }

    .info-text-label {
      font-weight: bold;
      padding-right: 10px;
    }

    .el-form--label-top .el-form-item__label {
      padding: 0;
    }

    .el-form-item {
      margin-bottom: 10px;
    }

    .el-tabs__item {
      font-size: 16px;
      font-weight: bold;
    }

    .item {
      display: inline-block;
      text-align: center;
      margin-right: 25px;
    }

    .item-image-container {
      width: 80px;
      height: 40px;
      /* border-radius: 50%; */
      /* border: 1px dashed #1E9FFF; */
      display: flex;
      justify-content: center;
      align-items: center;
      /* cursor: pointer; */
    }

    .item-text {
      font-weight: bold;
      font-size: 16px;
      color: #1E9FFF;
      margin-top: 5px;
    }

    .handle-container {
      border-radius: 4px;
      border: 1px solid #EBEEF5;
      background-image: linear-gradient(to right, #C4E6FF 0%, #fff 100%);
      margin-top: 10px;
      padding: 10px;
      box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
    }

    .item-icon {
      font-size: 35px;
      color: #1E9FFF;
      transition: all 1.5s;
      font-size: 30px;
    }

    .sub-menu-icon {
      font-size: 20px !important;
      transition: all 1.5s;
    }

    .sub-menu-icon:hover {
      transform: scale(1.3) rotate(360deg);
    }

    .item-icon:hover {
      transform: scale(1.3) rotate(360deg);
    }

    /* 覆盖菜单项样式 */
    .el-menu-item {
      padding-left: 20px !important;
    }

    .el-menu-item.is-active {
      font-weight: bold;
      color: #1E9FFF;
      border: 1px dashed #1E9FFF;
      border-radius: 10px;
      font-size: 16px;
    }

    /* 待报工 */
    #unReport .el-menu-item.is-active {
      color: #67C23A;
      border: 1px dashed #67C23A;
    }

    /* 待检验 */
    #unCheck .el-menu-item.is-active {
      color: #F56C6C;
      border: 1px dashed #F56C6C;
    }

    .el-tree-node__content {
      height: 30px !important;
    }

    .el-tree-node__content:hover {
      font-weight: bold;
      color: #409EFF;
    }

    /* 徽标 */
    .el-badge__content.is-fixed {
      top: 5px;
    }
  </style>
</head>

<body>
  <div id="app" v-cloak>
    <el-watermark :content="'RS031'"></el-watermark>
    <!-- 头部标题区域 -->
    <el-row class="header">
      <el-col :span="6">
        <div style="display: flex;align-items: center;position: relative;">
          <el-icon style="font-size: 22px;margin-left: 10px;">
            <home-filled />
          </el-icon>
          <span style="font-size: 20px;margin-left: 5px;font-weight: bold;">中国航发黎阳-制造执行系统</span>
        </div>
      </el-col>
      <el-col :span="14">
        <el-breadcrumb separator="/">
          <el-breadcrumb-item>{{userInfo.factoryname}}</el-breadcrumb-item>
          <el-breadcrumb-item>{{userInfo.workcentername}}</el-breadcrumb-item>
          <el-breadcrumb-item>{{userInfo.teamname ? userInfo.teamname : '--'}}</el-breadcrumb-item>
        </el-breadcrumb>
      </el-col>
      <el-col :span="4" style="text-align: right;">
        <span style="margin-right:20px;">{{currentTime}}</span>
      </el-col>
    </el-row>

    <!-- 中间部分 -->
    <el-row :gutter="10" style="margin: 10px 5px;">
      <!-- 左侧 -->
      <el-col :span="4">
        <!-- 个人信息 -->
        <el-card class="box-card">
          <template #header>
            <div style="display: flex;align-items: center;position: relative;">
              <el-icon class="card-header-icon">
                <Avatar />
              </el-icon>
              <span class="card-header-text">个人信息</span>
              <el-button round class="flush-btn" @click="handleUserInfoFlushClick">
                <el-icon class="sub-menu-icon">
                  <Refresh />
                </el-icon>
                <span style="margin-left: 6px;">刷新</span>
              </el-button>
            </div>
          </template>
          <el-row :gutter="10">
            <el-col :span="8">
              <div v-if="userInfo.userimageurl">
                <el-image style="width: 105px;height: 140px;" :src="userInfo.userimageurl"
                  :preview-src-list="[userInfo.userimageurl]">
                </el-image>
              </div>
              <div v-else>
                <el-image style="width: 105px;height: 140px;border:1px dashed #1E9FFF;">
                </el-image>
              </div>
            </el-col>
            <el-col :span="16">
              <div class="info-text">
                <span class="info-text-label">姓名:</span>{{userInfo.fullname}}
              </div>
              <div class="info-text">
                <span class="info-text-label">工时分值:</span>{{worktimeInfo.txtTimeAttribute}}
              </div>
              <div class="info-text">
                <span class="info-text-label">总工时:</span>{{worktimeInfo.txtSumWorkTime}}
              </div>
              <div class="info-text">
                <span class="info-text-label">总绩效:</span>{{worktimeInfo.txtSumJX}}
              </div>
            </el-col>
          </el-row>
        </el-card>

        <!-- 我的任务 -->
        <el-card class="box-card" style="margin-top: 10px;">
          <template #header>
            <div style="display: flex;align-items: center;position: relative;">
              <el-icon class="card-header-icon">
                <Flag />
              </el-icon>
              <span class="card-header-text">我的任务</span>
              <el-button round class="flush-btn" @click="handleContainerSearchBlur(1)">
                <el-icon class="sub-menu-icon">
                  <Refresh />
                </el-icon>
                <span style="margin-left: 6px;">刷新</span>
              </el-button>
            </div>
          </template>

          <el-scrollbar :height="clientHeight">
            <el-form style="margin:10px 20px;">
              <el-form-item>
                <el-input v-model="searchObj.containername" placeholder="请扫卡或输入任务单号、订单号"
                  @blur="handleContainerSearchBlur" clearable>
                </el-input>
              </el-form-item>
            </el-form>
            <el-menu>
              <!-- 待报工 -->
              <el-sub-menu index="待报工">
                <template #title>
                  <el-icon style="color:#67C23A" class="sub-menu-icon">
                    <video-play />
                  </el-icon>
                  <el-badge :value="containerSearchScan.unReportDataRows" :max="1000" type="success">
                    <span style="font-size: 18px;color:#67C23A;">待报工</span>
                  </el-badge>
                </template>
                <el-menu-item v-for="i in containerSearchScan.notReportedList" :key="i.CONTAINERNO"
                  :label="i.CONTAINERNO" :value="i.CONTAINERNO" :index="i.CONTAINERNO" @click="selectContainerMenu">
                  <el-popover trigger="hover" placement="top" width="300">
                    <p>订单号：{{i.MFGORDERNAME}}</p>
                    <p>发动机号：{{i.MACHINENAME}}</p>
                    <p>件号名称：{{i.PRODUCTDESC}}</p>
                    <template #reference>
                      <el-icon>
                        <info-filled />
                      </el-icon>
                    </template>
                  </el-popover>
                  {{i.CONTAINERNO}}【{{i.WORKFLOWSTEPNAME}}】
                </el-menu-item>
              </el-sub-menu>
              <!-- 待检验 -->
              <el-sub-menu index="待检验">
                <template #title>
                  <el-icon style="color:#F56C6C" class="sub-menu-icon">
                    <Stamp />
                  </el-icon>
                  <el-badge :value="containerSearchScan.unCheckContainerCount" :max="1000" type="danger">
                    <span style="font-size: 18px;color:#F56C6C;">待检验</span>
                  </el-badge>
                </template>
                <el-menu-item v-for="i in containerSearchScan.unCheckContainerData" :key="i.CONTAINERNO"
                  :label="i.CONTAINERNO" :value="i.CONTAINERNO" :index="'待检验&' + i.CONTAINERNO">
                  {{i.CONTAINERNO}}【{{i.MACHINENAME}}】
                </el-menu-item>
              </el-sub-menu>
            </el-menu>
        </el-card>
      </el-col>

      <!-- 右侧 -->
      <el-col :span="20">
        <!-- 生产报工区域 -->
        <el-card class="box-card">
          <template #header>
            <div style="display: flex;align-items: center;">
              <el-icon class="card-header-icon">
                <video-play />
              </el-icon>
              <span class="card-header-text">生产报工</span>
            </div>
          </template>
          <div style="padding: 10px;">
            <!-- 批次信息 -->
            <el-form :inline="true" :model="formData" :label-position="'top'">
              <el-form-item label="扫描任务单">
                <el-input v-model="formData.ContainerNo" style="width: 140px;" clearable></el-input>
              </el-form-item>

              <el-form-item label="发动机号(起)">
                <el-input v-model="formData.MachineStart" style="width: 120px;" clearable></el-input>
              </el-form-item>

              <el-form-item label="发动机号(止)">
                <el-input style="width: 100px;" v-model="formData.MachineEnd" clearable></el-input>
              </el-form-item>

              <el-form-item label="计划开始/结束日期">
                <el-date-picker v-model="formData.daterange" type="daterange" range-separator="至"
                  start-placeholder="开始日期" end-placeholder="结束日期" style="width:250px" />
              </el-form-item>
              <el-form-item label=" ">
                <el-button type="primary" style="margin-top: 20px;" @click="queryReportData">查询</el-button>
                <el-button plain style="margin-top: 20px;" @click="qureyReset">重置</el-button>
              </el-form-item>
            </el-form>

            <el-scrollbar :height="inputHeight+125">
              <!-- 任务单单信息 -->
              <el-tabs v-model="tabfirst">
                <el-tab-pane label="任务单信息" name="first" style="width: 100%;">
                  <el-table border style="width: 100%" :data="containerList" :height="tableHeight-190"
                    ref="containerTableRef" @row-click="selectContainerRow" highlight-current-row>
                    <el-table-column type="index" width="40"></el-table-column>
                    <el-table-column prop="MACHINENAME" label="发动机号" width="180"></el-table-column>
                    <el-table-column prop="CONTAINERNO" label="任务单号" width="180"></el-table-column>
                    <el-table-column prop="PRODUCTDESC" label="件号名称" width="180"></el-table-column>
                    <el-table-column prop="WORKFLOWNAMEVER" label="工艺路线信息"></el-table-column>
                    <el-table-column prop="WFDESC" label="工艺路线名称" width="180"></el-table-column>
                    <el-table-column prop="MACHINESTEPNAME" label="阶段" width="180"></el-table-column>
                    <el-table-column prop="PLANNEDSTARTDATE" label="计划开始时间" width="180" :formatter="dateFormatter">
                    </el-table-column>
                    <el-table-column prop="PLANNEDCOMPLETIONDATE" label="计划结束时间" width="180" :formatter="dateFormatter">
                    </el-table-column>
                  </el-table>
                </el-tab-pane>
              </el-tabs>
              <el-row>
                <el-col :span="15">
                  <!-- 工序信息 -->
                  <el-tabs v-model="tabfirst">
                    <el-tab-pane label="工序信息" name="first" style="width: 100%;">
                      <el-table border style="width: 100%" :data="specList" :height="200" ref="specTableRef"
                        @selection-change="selectSpecChange">
                        <el-table-column type="selection" width="40"></el-table-column>
                        <el-table-column prop="OPDESC" label="工序" show-overflow-tooltip></el-table-column>
                        <el-table-column prop="SPECNO" label="工序号" width="80"></el-table-column>
                        <el-table-column prop="ISLASTSTEP" label="是否末序" width="80"></el-table-column>
                        <el-table-column prop="ISKEY" label="是否关键序" width="90"></el-table-column>
                        <el-table-column prop="WORKCENTER" label="并行工序组" width="90"></el-table-column>
                        <el-table-column prop="TEAMNAME" label="责任班组" width="90"></el-table-column>
                        <el-table-column prop="STATUS" label="任务状态" width="80"></el-table-column>
                        <el-table-column prop="PLANNEDSTARTDATE" label="计划开始时间" width="110" :formatter="dateFormatter">
                        </el-table-column>
                        <el-table-column prop="PLANNEDFINISHDATE" label="计划结束时间" width="110" :formatter="dateFormatter">
                        </el-table-column>
                        <el-table-column prop="SENDSTATUS" label="配送提请状态" width="110"></el-table-column>
                      </el-table>
                    </el-tab-pane>
                  </el-tabs>
                </el-col>
                <!-- 工步信息 -->
                <el-col :span="9">
                  <el-tabs v-model="tabfirst">
                    <el-tab-pane label="工步信息" name="first" style="width: 100%;">
                      <el-table border style="width: 100%" :data="stepList" :height="200" ref="stepTableRef">
                        <el-table-column type="selection" width="40"></el-table-column>
                        <el-table-column prop="WORKFLOWSTEPNAME" label="工序" show-overflow-tooltip></el-table-column>
                        <el-table-column prop="STEPINFODESC" label="工步" width="100" show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column prop="STEPSEQ" label="工步序号" width="80"></el-table-column>
                        <el-table-column prop="SPECTYPENAME" label="工步类型" width="100"></el-table-column>
                        <el-table-column prop="TEAMNAME" label="班组" width="100"></el-table-column>
                        <el-table-column prop="DISPATCHFULLNAME" label="派工人" width="80"></el-table-column>
                      </el-table>
                    </el-tab-pane>
                    <el-form :inline="true" :label-position="'top'">
                      <el-form-item label="超期报工原因类型">
                        <el-select v-model="lossReasonValue" placeholder="请选择" style="width: 140px">
                          <el-option label="" value=""></el-option>
                          <el-option v-for="item in lossReason.value" :label="item.LOSSREASONNAME"
                            :value="item.LOSSREASONID" style="width:400px"></el-option>
                        </el-select>
                      </el-form-item>
                      <el-form-item label=" " style="width: 350px;">
                        <el-input v-model="lossReasonNote" type="textarea" placeholder="超期报工原因"></el-input>
                      </el-form-item>
                    </el-form>
                  </el-tabs>
                </el-col>
              </el-row>
            </el-scrollbar>
          </div>
        </el-card>
        <!-- 按钮区域 -->
        <div class="handle-container">
          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handleLookProgress">
                <el-icon class="item-icon">
                  <Odometer />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">查看准备进度</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handleDocumentViewClick">
                <el-icon class="item-icon">
                  <Document />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">工艺查看</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handleReceiveDispatch">
                <el-icon class="item-icon">
                  <Avatar />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">任务接收</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handleSendDeliveryApply">
                <el-icon class="item-icon">
                  <video-play />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">发起配送提请</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handleReciveMaterialConfirm">
                <el-icon class="item-icon">
                  <circle-check />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">收料确认</div>
          </div>
          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handleWorkflowstepOpenWork">
                <el-icon class="item-icon">
                  <Open />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">开工</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handlePuplIssueOperate">
                <el-icon class="item-icon">
                  <icon-menu />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">装配操作</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handlePupSplitOperate">
                <el-icon class="item-icon">
                  <Paperclip />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">分解操作</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handlePupInputChechPoint">
                <el-icon class="item-icon">
                  <Edit />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">实测值录入</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handleMESFeedbackClick">
                <el-icon class="item-icon">
                  <question-filled />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">问题快反</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handleQualityProblemLook">
                <el-icon class="item-icon">
                  <zoom-in />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">质量问题查看</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handlePupPartRecept">
                <el-icon class="item-icon">
                  <Operation />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">零组件交换</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handleContainerStepWorkReport">
                <el-icon class="item-icon">
                  <Finished />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">报工</div>
          </div>

          <div class="item">
            <div class="item-image-container">
              <el-link :underline="false" @click="handleNCProgramViewClick">
                <el-icon class="item-icon">
                  <icon-view />
                </el-icon>
              </el-link>
            </div>
            <div class="item-text">NC附件查看</div>
          </div>
        </div>
      </el-col>
    </el-row>
    <!-- 准备进度查看/收料确认对话框 -->
    <el-dialog v-model="lookProgress.lookProgressDialogVisible" :title="lookProgress.isLook===true?'准备进度查看':'收料确认'"
      width="50%" :draggable="true" align-center>
      <el-scrollbar :height="inputHeight+125">
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="工序信息" name="first" style="width: 100%;">
            <el-descriptions class="margin-top" :column="4" :size="small" border>
              <el-descriptions-item label="任务单号">
                {{lookProgress.containerspecInfo.CONTAINERNO}}
              </el-descriptions-item>
              <el-descriptions-item label="发动机号">
                {{lookProgress.containerspecInfo.MACHINENAME}}
              </el-descriptions-item>
              <el-descriptions-item label="订单号">
                {{lookProgress.containerspecInfo.MFGORDERNAME}}
              </el-descriptions-item>
              <el-descriptions-item label="件号名称">
                {{lookProgress.containerspecInfo.PRODUCTDESC}}
              </el-descriptions-item>
              <el-descriptions-item label="阶段">
                {{lookProgress.containerspecInfo.MACHINESTEPNAME}}
              </el-descriptions-item>
              <el-descriptions-item label="工序">
                {{lookProgress.containerspecInfo.WORKFLOWSTEPNAME}}
              </el-descriptions-item>
              <el-descriptions-item label="开始计划时间">
                {{lookProgress.containerspecInfo.PLANNEDSTARTDATE}}
              </el-descriptions-item>
              <el-descriptions-item label="开始完成时间">
                {{lookProgress.containerspecInfo.PLANNEDCOMPLETIONDATE}}
              </el-descriptions-item>
            </el-descriptions>
          </el-tab-pane>
        </el-tabs>
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="去封报工结果" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="lookProgress.bigList" ref="bigLookListRef">
              <el-table-column prop="PRODUCTNAME" label="大件号" width="110"></el-table-column>
              <el-table-column prop="PRODUCTDESC" label="件号名称" width="150"></el-table-column>
              <el-table-column prop="FIRSTASSEMBLEQTY" label="单台数量" width="110"></el-table-column>
              <el-table-column prop="PRODUCTBATCHNO" label="批次号" width="100"></el-table-column>
              <template v-if="lookProgress.isLook">
                <el-table-column prop="TOTALCOLLECTQTY" label="已报数量" width="110"></el-table-column>
                <el-table-column prop="OPDESC4" label="未报数量" width="80">
                  <template #default="scope">
                    {{scope.row.FIRSTASSEMBLEQTY-scope.row.TOTALCOLLECTQTY
                    <0?0:scope.row.FIRSTASSEMBLEQTY-scope.row.TOTALCOLLECTQTY}} </template>
                </el-table-column>
                <el-table-column prop="OPDESC4" label="完成进度">
                  <template #default="scope">
                    <el-tag :type="danger">
                      {{scope.row.TOTALCOLLECTQTY/scope.row.FIRSTASSEMBLEQTY*100>100?'100%':scope.row.TOTALCOLLECTQTY/scope.row.FIRSTASSEMBLEQTY*100+'%'}}
                    </el-tag>
                  </template>
                </el-table-column>
              </template>
              <template v-if="!lookProgress.isLook">
                <el-table-column prop="SENDQTY" label="本次配送数量" width="130"></el-table-column>
                <el-table-column prop="EDITORQTY" label="未配送数量" width="130"> </el-table-column>
                <el-table-column prop="NNORECEIVEQTY" label="本次收料数量">
                  <template #default="scope">
                    <el-input v-model="scope.row.NNORECEIVEQTY" type="number" min="0"
                      :disabled="!Number(scope.row.NNORECEIVEQTY)>0"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="NORECEIVEQTY" label="未收料数量" width="130"></el-table-column>
              </template>
            </el-table>
          </el-tab-pane>
        </el-tabs>
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="集件报工结果" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="lookProgress.smallList" ref="smallLookListRef">
              <el-table-column prop="PRODUCTNAME" label="小件号" width="110"></el-table-column>
              <el-table-column prop="PRODUCTDESC" label="件号名称" width="150"></el-table-column>
              <el-table-column prop="FIRSTASSEMBLEQTY" label="单台数量" width="110"></el-table-column>
              <el-table-column prop="PRODUCTBATCHNO" label="批次号" width="100"></el-table-column>
              <template v-if="lookProgress.isLook">
                <el-table-column prop="TOTALCOLLECTQTY" label="已报数量" width="110"></el-table-column>
                <el-table-column prop="OPDESC4" label="未报数量" width="80">
                  <template #default="scope">
                    {{scope.row.FIRSTASSEMBLEQTY-scope.row.TOTALCOLLECTQTY
                    <0?0:scope.row.FIRSTASSEMBLEQTY-scope.row.TOTALCOLLECTQTY}} </template>
                </el-table-column>
                </el-table-column>
                <el-table-column prop="OPDESC4" label="完成进度">
                  <template #default="scope">
                    <el-tag :type="danger">
                      {{scope.row.TOTALCOLLECTQTY/scope.row.FIRSTASSEMBLEQTY*100>100?'100%':scope.row.TOTALCOLLECTQTY/scope.row.FIRSTASSEMBLEQTY*100+'%'}}
                    </el-tag>
                  </template>
                </el-table-column>
              </template>
              <template v-if="!lookProgress.isLook">
                <el-table-column prop="SENDQTY" label="本次配送数量" width="130"></el-table-column>
                <el-table-column prop="EDITORQTY" label="未配送数量" width="130"> </el-table-column>
                <el-table-column prop="NNORECEIVEQTY" label="本次收料数量">
                  <template #default="scope">
                    <el-input v-model="scope.row.NNORECEIVEQTY" type="number" min="0"
                      :disabled="!Number(scope.row.NNORECEIVEQTY)>0"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="NORECEIVEQTY" label="未收料数量" width="130"></el-table-column>
              </template>
            </el-table>
          </el-tab-pane>
        </el-tabs>
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="工装工具准备结果" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="lookProgress.toolList" ref="toolLookListRef">
              <el-table-column prop="TOOLNAME" label="工装工具编号" width="110" v-if="lookProgress.isLook"></el-table-column>
              <el-table-column prop="DESCRIPTION" label="工装工具名称" width="150"></el-table-column>
              <el-table-column :prop="lookProgress.isLook?'DRAWINGNO':'NAME'" label="工装工具图号" width="110">
              </el-table-column>
              <el-table-column prop="SPECIFICATION" label="型号规格" width="100"></el-table-column>
              <el-table-column :prop="lookProgress.isLook?'TOOLTYPE':'RESOURCETYPENAME'" label="工装工具类型" width="110">
              </el-table-column>
              <el-table-column prop="QTY" label="需求数量" width="80"></el-table-column>
              <template v-if="lookProgress.isLook">
                <el-table-column prop="PREPAREQTY" label="已准备数量" width="100"></el-table-column>
                <el-table-column prop="NOPREPAREQTY" label="未准备数量" width="100"></el-table-column>
                <el-table-column prop="OPDESC5" label="完成进度">
                  <template #default="scope">
                    <el-tag :type="danger">
                      {{scope.row.PREPAREQTY/scope.row.QTY*100>100?'100%':scope.row.PREPAREQTY/scope.row.QTY*100+'%'}}
                    </el-tag>
                  </template>
                </el-table-column>
              </template>
              <template v-if="!lookProgress.isLook">
                <el-table-column prop="CONFIRMQTY" label="本次配送数量" width="110"></el-table-column>
                <el-table-column prop="NOCONFIRMQTY" label="未配送数量" width="100">
                  <template #default="scope">
                    {{scope.row.QTY-scope.row.CONFIRMQTY}}
                  </template>
                </el-table-column>
                <el-table-column prop="NNORECEIVEQTY" label="本次收料数量">
                  <template #default="scope">
                    <el-input v-model="scope.row.NNORECEIVEQTY" type="number" min="0"
                      :disabled="!Number(scope.row.NNORECEIVEQTY)>0"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="NNORECEIVEQTY1" label="未收料数量" width="100">
                  <template #default="scope">
                    {{scope.row.CONFIRMQTY-scope.row.RECEIVEQTY}}
                  </template>
                </el-table-column>
              </template>
            </el-table>
          </el-tab-pane>
        </el-tabs>
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="辅材准备结果" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="lookProgress.materialList" ref="materialLookListRef">
              <el-table-column :prop="lookProgress.isLook?'AUXMATERIALNAME':'NAME'" label="物料编码" width="110">
              </el-table-column>
              <el-table-column prop="DESCRIPTION" label="物料描述" width="150"></el-table-column>
              <el-table-column prop="SPECIFICATION" label="型号规格" width="110"></el-table-column>
              <el-table-column prop="RESOURCETYPENAME" label="材料类型" width="100"></el-table-column>
              <el-table-column prop="QTY" label="需求数量" width="100"></el-table-column>
              <template v-if="lookProgress.isLook">
                <el-table-column prop="PREPAREQTY" label="已准备数量" width="110"></el-table-column>
                <el-table-column prop="NOPREPAREQTY" label="未准备数量" width="110"></el-table-column>
                <el-table-column prop="OPDESC4" label="完成进度">
                  <template #default="scope">
                    <el-tag :type="danger">
                      {{scope.row.PREPAREQTY/scope.row.QTY*100>100?'100%':scope.row.PREPAREQTY/scope.row.QTY*100+'%'}}
                    </el-tag>
                  </template>
                </el-table-column>
            </el-table>
          </el-tab-pane>
          </template>
          <template v-if="!lookProgress.isLook">
            <el-table-column prop="CONFIRMQTY" label="本次配送数量" width="110"></el-table-column>
            <el-table-column prop="NOCONFIRMQTY" label="未配送数量" width="100">
              <template #default="scope">
                {{scope.row.QTY-scope.row.CONFIRMQTY}}
              </template>
            </el-table-column>
            <el-table-column prop="NNORECEIVEQTY" label="本次收料数量">
              <template #default="scope">
                <el-input v-model="scope.row.NNORECEIVEQTY" type="number" min="0"
                  :disabled="!Number(scope.row.NNORECEIVEQTY)>0"></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="NNORECEIVEQTY1" label="未收料数量" width="100">
              <template #default="scope">
                {{scope.row.CONFIRMQTY-scope.row.RECEIVEQTY}}
              </template>
            </el-table-column>
          </template>
        </el-tabs>
        <!-- <el-tabs v-model="tabfirst">
          <el-tab-pane label="设备准备结果" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="lookProgress.equList">
              <el-table-column prop="PRODUCTNAME" label="设备编码" width="110"></el-table-column>
              <el-table-column prop="PRODUCTDESC" label="设备名称" width="150"></el-table-column>
              <el-table-column prop="FIRSTASSEMBLEQTY" label="型号规格" width="110"></el-table-column>
              <el-table-column prop="PRODUCTBATCHNO" label="设备类型" width="100"></el-table-column>
              <el-table-column prop="TOTALCOLLECTQTY" label="状态" width="80"></el-table-column>
              <el-table-column prop="OPDESC4" label="设备编号" width="80"></el-table-column>
              <el-table-column prop="OPDESC4" label="设备状态"></el-table-column>
            </el-table>
          </el-tab-pane>
        </el-tabs> -->
      </el-scrollbar>
      <template #footer>
        <span class="dialog-footer">
          <template v-if="!lookProgress.isLook">
            <el-button type="primary" @click="handleReceiveBigSmall(0)">去封收料确认</el-button>
            <el-button type="success" @click="handleReceiveBigSmall(1)">集件收料确认</el-button>
            <el-button type="warning" @click="handleRTReceive(1)">工装工具收料确认</el-button>
            <el-button type="danger" @click="handleRTReceive(2)">辅材收料确认</el-button>
          </template>
          <el-button @click="lookProgress.lookProgressDialogVisible = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>

    <!-- 文档查看对话框 -->
    <el-dialog v-model="documentViewDialogVisible" title="文档查看" width="60%" :draggable="true" align-center>
      <el-row :gutter="10">
        <el-col :span="14">
          <el-scrollbar height="400">
            <el-card>
              <template #header>
                <div style="display: flex;align-items: center;position: relative;">
                  <el-icon class="card-header-icon" style="font-size: 20px;">
                    <info-filled />
                  </el-icon>
                  <span class="card-header-text">工艺信息</span>
                </div>
              </template>
              <el-tree :data="treeData" node-key="id" :default-expand-all="true" :expand-on-click-node="false"
                @node-click="handleNodeClick">
                <template #default="scope">
                  <el-icon v-if="scope.data.type !== 'spec'" style="color:orange;margin-right: 10px;">
                    <Folder />
                  </el-icon>
                  <el-icon v-else style="margin-right: 10px;">
                    <Grid />
                  </el-icon>
                  {{scope.data.label}}
                </template>
              </el-tree>
            </el-card>
          </el-scrollbar>
        </el-col>
        <el-col :span="10">
          <el-card>
            <template #header>
              <div style="display: flex;align-items: center;position: relative;">
                <el-icon class="card-header-icon" style="font-size: 20px;">
                  <List />
                </el-icon>
                <span class="card-header-text">文档清单</span>
              </div>
            </template>
            <el-table :data="documentList" stripe border>
              <el-table-column type="index" width="50"></el-table-column>
              <el-table-column label="文档名称" prop="documentname" show-overflow-tooltip>
              </el-table-column>
              <el-table-column label="操作" prop="filepath" width="120">
                <template #default="scope">
                  <el-link type="primary" @click="handleOpenDocumentClick(scope.row.filepath)">查看文档</el-link>
                </template>
              </el-table-column>
            </el-table>
          </el-card>
        </el-col>
      </el-row>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="documentViewDialogVisible = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>

    <!-- 发起配送提请对话框 -->
    <el-dialog v-model="sendDeliveryApply.sendDeliveryApplyDialogVisible" title="发送提请" width="50%" :draggable="true"
      align-center>
      <el-scrollbar :height="inputHeight+125">
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="大小件信息" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="sendDeliveryApply.bigsmallList" ref="bigsmallListRef">
              <el-table-column type="selection" width="40"></el-table-column>
              <el-table-column prop="WORKFLOWSTEPNAME" label="工序" width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="PRODUCTNAME" label="件号" width="110"></el-table-column>
              <el-table-column prop="PRODUCTDESC" label="件号名称" width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="PARTTYPE" label="类型" width="80"></el-table-column>
              <el-table-column prop="PRODUCTBATCHNO" label="批次号" width="130"></el-table-column>
              <el-table-column prop="FIRSTASSEMBLEQTY" label="集件数量" width="80"></el-table-column>
              <el-table-column prop="TOTALCOLLECTQTY" label="去封/集件报工数" width="150"></el-table-column>
              <el-table-column prop="STATUS" label="是否发送">
                <template #default="scope">
                  <el-tag :type="scope.row.STATUS==='未发送'?'danger':''">
                    {{scope.row.STATUS}}
                  </el-tag>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
        </el-tabs>
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="工装工具信息" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="sendDeliveryApply.toolList" ref="toolListRef">
              <el-table-column type="selection" width="40"></el-table-column>
              <el-table-column prop="WORKFLOWSTEPNAME" label="工序" width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="NAME" label="工具编号" width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="DESCRIPTION" label="工具名称" width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="SPECIFICATION" label="规格" width="100"></el-table-column>
              <el-table-column prop="RESOURCETYPENAME" label="类型" width="110"></el-table-column>
              <el-table-column prop="QTY" label="需求数量" width="110"></el-table-column>
              <el-table-column prop="STATUS" label="是否发送">
                <template #default="scope">
                  <el-tag :type="scope.row.STATUS==='未发送'?'danger':''">
                    {{scope.row.STATUS}}
                  </el-tag>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
        </el-tabs>
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="辅材信息" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="sendDeliveryApply.materialList" ref="materialListRef">
              <el-table-column type="selection" width="40"></el-table-column>
              <el-table-column prop="WORKFLOWSTEPNAME" label="工序" width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="AUXMATERIALNAME" label="辅材编码" width="110"></el-table-column>
              <el-table-column prop="DESCRIPTION" label="辅材名称" width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="SPECIFICATION" label="规格" width="110"></el-table-column>
              <el-table-column prop="RESOURCETYPENAME" label="类型" width="100"></el-table-column>
              <el-table-column prop="QTY" label="需求数量" width="110"></el-table-column>
              <el-table-column prop="STATUS" label="是否发送">
                <template #default="scope">
                  <el-tag :type="scope.row.STATUS==='未发送'?'danger':''">
                    {{scope.row.STATUS}}
                  </el-tag>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
        </el-tabs>
      </el-scrollbar>
      <template #footer>
        <span class="dialog-footer">
          <el-button type="primary" @click="handleSendRequset(1)">大小件提请</el-button>
          <el-button type="success" @click="handleSendRequset(3)">工装工具提请</el-button>
          <el-button type="warning" @click="handleSendRequset(2)">辅材提请</el-button>
          <el-button @click="sendDeliveryApply.sendDeliveryApplyDialogVisible = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>
    <!-- 装配操作对话框 -->
    <el-dialog v-model="IssueOperate.IssueOperateDialogVisible" title="装配操作" width="50%" :draggable="true" align-center>
      <el-scrollbar :height="inputHeight+125">
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="工序工步信息" name="first" style="width: 100%;">
            <el-row>
              <el-col :span="8">
                <el-table border style="width: 100%" :data="IssueOperate.specstepList" :height="200"
                  @row-click="selectSpecBigSmall" highlight-current-row>
                  <el-table-column prop="WORKFLOWSTEPNAME" label="工序" width="150" show-overflow-tooltip>
                  </el-table-column>
                  <el-table-column prop="STEPINFONAME" label="工步" show-overflow-tooltip></el-table-column>
                </el-table>
              </el-col>
              <el-col :span="16">
                <el-table border style="width: 100%" :data="IssueOperate.bigsmallList" :height="200"
                  @row-click="selectIssueBigSmall" highlight-current-row>
                  <el-table-column prop="PRODUCTNAME" label="件号" show-overflow-tooltip></el-table-column>
                  <el-table-column prop="PRODUCTBATCHNO" label="批次号" width="150" show-overflow-tooltip>
                  </el-table-column>
                  <el-table-column prop="FIRSTASSEMBLEQTY" label="单台数" width="150"></el-table-column>
                  <el-table-column prop="CONFIRMQTY" label="确认数量" width="150"></el-table-column>
                </el-table>
              </el-col>
            </el-row>
          </el-tab-pane>
        </el-tabs>
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="装入管理" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="IssueOperate.IssueOperateList" :height="200">
              <el-table-column type="expand">
                <template #default="props">
                  <el-table border style="width: 100%" :data="IssueOperate.IssueOperateRecordList" :height="200"
                    @row-click="selectIssueOperateRecord" highlight-current-row>
                    <el-table-column prop="PRODUCTNAME" label="件号" width="150" show-overflow-tooltip></el-table-column>
                    <el-table-column prop="PRODUCTBATCHNO" label="批次号" width="110"></el-table-column>
                    <el-table-column prop="QTY" label="装配数量" width="110"></el-table-column>
                    <el-table-column prop="ISSUETYPEDESC" label="装配类型" width="110"></el-table-column>
                    <el-table-column prop="ISSUEREASONDESC" label="装配原因" width="100"></el-table-column>
                    <el-table-column prop="GUIDEDOC" label="指导文件" width="150" show-overflow-tooltip></el-table-column>
                    <el-table-column prop="EMPLOYEENAME" label="操作工" width="80"></el-table-column>
                    <el-table-column prop="CREATEDATE" label="装入时间"></el-table-column>
                  </el-table>
                </template>
              </el-table-column>
              <el-table-column prop="WORKFLOWSTEPNAME" label="工序" show-overflow-tooltip></el-table-column>
              <el-table-column prop="STEPINFONAME" label="工步" width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="PRODUCTNAME" label="件号" width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="FIRSTASSEMBLEQTY" label="单台数量" width="110"></el-table-column>
              <el-table-column prop="issueQty" label="已装数量" width="100"></el-table-column>
            </el-table>
          </el-tab-pane>
          <el-form :model="IssueOperateInfo" :inline="true" :label-position="'top'">
            <el-form-item label="件号">
              <el-input v-model="IssueOperateInfo.PRODUCTNAME" style="width: 130px;" disabled></el-input>
            </el-form-item>
            <el-form-item label="批次号">
              <el-input v-model="IssueOperateInfo.PRODUCTBATCHNO" style="width: 130px;" disabled></el-input>
            </el-form-item>
            <el-form-item label="单台数量">
              <el-input v-model="IssueOperateInfo.FIRSTASSEMBLEQTY" style="width: 130px;" disabled></el-input>
            </el-form-item>
            <el-form-item label="确认数量">
              <el-input v-model="IssueOperateInfo.CONFIRMQTY" style="width: 130px;" disabled></el-input>
            </el-form-item>
            <el-form-item label="已装入数量">
              <el-input v-model="IssueOperateInfo.INQTY" style="width: 130px;" disabled></el-input>
            </el-form-item>
            <el-form-item label="本次装入数量">
              <el-input v-model="IssueOperateInfo.NOWQTY" style="width: 130px;" type="number" min="0">
              </el-input>
            </el-form-item>
            <el-form-item label="原因">
              <el-select v-model="IssueOperateInfo.Reason" style="width: 140px;" clearable>
                <el-option label="正常装配" value="0"></el-option>
                <el-option label="反复装配" value="1"></el-option>
                <el-option label="报废换新件" value="2"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="装入件类型">
              <el-select v-model="IssueOperateInfo.Type" style="width: 140px;" clearable>
                <el-option label="正常件" value="0"></el-option>
                <el-option label="选配件" value="1"></el-option>
                <el-option label="替换件" value="2"></el-option>
                <el-option label="周转件" value="3"></el-option>
                <el-option label="串件" value="4"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="指导文件">
              <el-select v-model="IssueOperateInfo.Doc" style="width: 140px;" clearable>
                <el-option label="正常的工艺过程" value="正常的工艺过程"></el-option>
                <el-option label="施工单" value="施工单"></el-option>
                <el-option label="技术服务单" value="技术服务单"></el-option>
                <el-option label="" value=""></el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-tabs>
      </el-scrollbar>
      <template #footer>
        <span class="dialog-footer">
          <el-button type="success" @click="saveIssueOperateRecord">提交</el-button>
          <el-button type="warning" @click="deleteIssueOperateRecord">删除</el-button>
          <el-button @click="IssueOperate.IssueOperateDialogVisible = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>
    <!-- 分解记录对话框 -->
    <el-dialog v-model="splitOperate.splitOperateDialogVisible" title="分解记录管理" width="50%" :draggable="true"
      align-center>
      <el-scrollbar :height="inputHeight+125">
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="分解管理" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="splitOperate.splitOperateList" :height="400"
              @row-click="selectsplitOperateRecord" highlight-current-row>
              <el-table-column prop="WORKFLOWSTEPNAME" label="工序" show-overflow-tooltip></el-table-column>
              <el-table-column prop="STEPINFONAME" label="工步" width="110" show-overflow-tooltip></el-table-column>
              <el-table-column prop="PRODUCTNAME" label="件号" width="130" show-overflow-tooltip></el-table-column>
              <el-table-column prop="PRODUCTBATCHNO" label="批次号" width="100" show-overflow-tooltip></el-table-column>
              <el-table-column prop="FIRSTASSEMBLEQTY" label="单台数量" width="80"></el-table-column>
              <el-table-column prop="QTY" label="装配数量" width="80"></el-table-column>
              <el-table-column prop="EMPLOYEENAME" label="操作工" width="80"></el-table-column>
              <el-table-column prop="CREATEDATE" label="装入时间"></el-table-column>
            </el-table>
            <el-pagination style="float: right;" v-model:current-page="splitOperate.currentPage"
              v-model:page-size="splitOperate.pageSize" :page-sizes="[100, 200, 300, 400]" :small="small"
              layout="total, sizes, prev, pager, next, jumper" :total="splitOperate.Total"
              @size-change="handleSizeChange" @current-change="handleCurrentChange" />
          </el-tab-pane>
          <el-form :model="splitOperateInfo" :inline="true" :label-position="'top'" style="display:inline-flex">
            <el-form-item label="件号">
              <el-input v-model="splitOperateInfo.PRODUCTNAME" style="width: 130px;" disabled></el-input>
            </el-form-item>
            <el-form-item label="单台数量">
              <el-input v-model="splitOperateInfo.FIRSTASSEMBLEQTY" style="width: 120px;" disabled></el-input>
            </el-form-item>
            <el-form-item label="装配数量">
              <el-input v-model="splitOperateInfo.QTY" style="width: 120px;" disabled></el-input>
            </el-form-item>
            <el-form-item label="分解数量">
              <el-input v-model="splitOperateInfo.NOWQTY" style="width: 120px;" type="number" min="0"></el-input>
            </el-form-item>
            <el-form-item label="原因">
              <el-select v-model="splitOperateInfo.Reason" style="width: 140px;" clearable>
                <el-option label="分解" value="0"></el-option>
                <el-option label="零组件报废" value="1"></el-option>
                <el-option label="零组件排故" value="2"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="指导文件">
              <el-select v-model="splitOperateInfo.Doc" style="width: 140px;" clearable>
                <el-option label="正常的工艺过程" value="正常的工艺过程"></el-option>
                <el-option label="施工单" value="施工单"></el-option>
                <el-option label="技术服务单" value="技术服务单"></el-option>
                <el-option label="" value=""></el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-tabs>
      </el-scrollbar>
      <template #footer>
        <span class="dialog-footer">
          <el-button type="success" @click="savesplitOperateRecord">提交</el-button>
          <el-button @click="splitOperate.splitOperateDialogVisible = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>
    <!-- 实测值对话框 -->
    <el-dialog v-model="checkPoint.checkPointDialogVisible" title="工序检测项实测值录入" width="60%" :draggable="true"
      align-center>
      <el-scrollbar :height="inputHeight+175">
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="批次信息" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="checkPoint.containerList" :height="200"
              @row-click="selectContainer" highlight-current-row>
              <el-table-column prop="MfgorderName" label="生产订单" show-overflow-tooltip></el-table-column>
              <el-table-column prop="Machine" label="发动机号" width="110" show-overflow-tooltip></el-table-column>
              <el-table-column prop="TogetherFlag" label="任务单号" width="130" show-overflow-tooltip></el-table-column>
              <el-table-column prop="WorkFlowStepName" label="当前工序" width="100" show-overflow-tooltip></el-table-column>
              <el-table-column prop="ProductName" label="零件号" width="80"></el-table-column>
              <el-table-column prop="ProductRev" label="零件版本" width="80"></el-table-column>
              <el-table-column prop="ProductDescription" label="零件名称" show-overflow-tooltip></el-table-column>
              <el-table-column prop="ContainerType" label="批次类型" width="80"></el-table-column>
              <el-table-column prop="StepinfoName" label="工步"></el-table-column>
            </el-table>
          </el-tab-pane>
        </el-tabs>
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="检测项信息" name="first" style="width: 100%;">
            <el-row>
              <el-col :span="16">
                <el-table border style="width: 100%" :data="checkPoint.checkPointList" :height="200"
                  ref="checkPointTableRef" @row-click="selectcheckPointRow"
                  @selection-change="handleSelectionCheckPointChange" highlight-current-row>
                  <el-table-column type="selection"></el-table-column>
                  <el-table-column prop="NAME" label="关键特性标识" show-overflow-tooltip width="110"></el-table-column>
                  <el-table-column prop="CHECKPOINTNOTEDIS" label="检测项内容" width="110">
                    <template #default="scope">
                      <div v-html="scope.row.CHECKPOINTNOTEDIS"></div>
                    </template>
                  </el-table-column>
                  <el-table-column prop="CHECKREQUIRE" label="规定值代号" width="100" show-overflow-tooltip>
                  </el-table-column>
                  <el-table-column prop="KEYCHECKNAME" label="关键过程检" width="100" show-overflow-tooltip>
                  </el-table-column>
                  <el-table-column prop="MEOPCHECKNAME" label="工序检" width="70" show-overflow-tooltip></el-table-column>
                  <el-table-column prop="QUALITYCHECKNAME" label="质保单" width="70"></el-table-column>
                  <el-table-column prop="DRAWINGREQUIRE" label="图纸要求" width="80"></el-table-column>
                  <el-table-column prop="INPUTNUM" label="录入次数" width="80"></el-table-column>
                  <el-table-column prop="STATUS" label="录入状态" width="80">
                    <template #default="scope">
                      <el-tag :type="scope.row.STATUS==='未录'?'danger':''">
                        {{scope.row.STATUS}}
                      </el-tag>
                    </template>
                  </el-table-column>
                  <el-table-column prop="CHECKSTATUS" label="检验状态">
                    <template #default="scope">
                      <el-tag :type="scope.row.CHECKSTATUS==='未录'?'danger':''">
                        {{scope.row.CHECKSTATUS}}
                      </el-tag>
                    </template>
                  </el-table-column>
                </el-table>
              </el-col>
              <el-col :span="8">
                <el-table border style="width: 100%" :data="checkPoint.checkPointResultList" :height="200"
                  @row-click="selectcheckPointResultRow" highlight-current-row>
                  <el-table-column prop="WORKCHECKPOINTRESULTNOTE" label="工人实测值" width="100">
                    <template #default="scope">
                      <div v-html="scope.row.WORKCHECKPOINTRESULTNOTE"></div>
                    </template>
                  </el-table-column>
                  <el-table-column prop="WORKER" label="工人" width="80"></el-table-column>
                  <el-table-column prop="CHECKPOINTRESULTNOTE" label="检验实测值" width="100">
                    <template #default="scope">
                      <div v-html="scope.row.CHECKPOINTRESULTNOTE"></div>
                    </template>
                  </el-table-column>
                  <el-table-column prop="CHECKER" label="检验员" width="80"></el-table-column>
                  <el-table-column prop="NOTES" label="备注" show-overflow-tooltip></el-table-column>
                </el-table>
              </el-col>
            </el-row>
          </el-tab-pane>
        </el-tabs>
        <el-row>
          <el-col :span="10">
            <iframe :src="checkPointUrl" style="border:none;width:100%;height:350px" id="pointContent"></iframe>
          </el-col>
          <el-col :span="14">
            <!-- <el-input v-model="checkPoint.Notes" type="textarea" label ="备注" placeholder="检验备注信息录入" style="margin-top: 20px;height: 100px;"></el-input> -->
          </el-col>
        </el-row>
      </el-scrollbar>
      <template #footer>
        <span class="dialog-footer">
          <el-button type="success" @click="saveCheckPointResult">保存</el-button>
          <el-button @click="checkPoint.checkPointDialogVisible = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>

    <!-- 质量问题查看对话框 -->
    <el-dialog v-model="qualityLook.qualityLookDialogVisible" title="质量问题查看" width="50%" :draggable="true" align-center>
      <el-scrollbar :height="inputHeight+125">
        <el-tabs v-model="tabfirst">
          <el-tab-pane label="质量问题查看" name="first" style="width: 100%;">
            <el-table border style="width: 100%" :data="qualityLook.qualityLookList" :height="500"
              highlight-current-row>
              <el-table-column prop="PRODUCTNAME" label="部件号" width="130" show-overflow-tooltip></el-table-column>
              <el-table-column prop="CONTENT" label="内容" show-overflow-tooltip></el-table-column>
              <el-table-column prop="ENGINENO" label="发动机号" width="130" show-overflow-tooltip></el-table-column>
              <el-table-column prop="ISADD" label="是否新增" width="100" show-overflow-tooltip></el-table-column>
              <el-table-column prop="FULLNAME" label="创建人" width="120"></el-table-column>
              <el-table-column prop="CREATETIME" label="创建时间"></el-table-column>
            </el-table>
          </el-tab-pane>
        </el-tabs>
      </el-scrollbar>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="qualityLook.qualityLookDialogVisible = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>

    <!-- 零组件对话框 -->
    <el-dialog v-model="partRecept.partReceptDialogVisible" title="零组件交换" width="70%" :draggable="true" align-center>
      <el-scrollbar :height="inputHeight+130">
        <el-row>
          <el-col :span="12">
            <el-tabs v-model="tabfirst">
              <el-tab-pane label="大件信息" name="first" style="width: 100%;">
                <el-table border style="width: 100%" :data="partRecept.bigList" :height="490"
                  ref="partReceptbigListRef">
                  <el-table-column type="selection" width="40"></el-table-column>
                  <el-table-column prop="PRODUCTNAME" label="件号" show-overflow-tooltip width="110"></el-table-column>
                  <el-table-column prop="DESCRIPTION" label="件号名称" show-overflow-tooltip></el-table-column>
                  <el-table-column prop="PRODUCTBATCHNO" label="批次" show-overflow-tooltip width="100"></el-table-column>
                  <el-table-column prop="SumQty" label="数量" width="70"></el-table-column>
                  <el-table-column prop="ASSEMBLEEMPLOYEE" label="配送人" width="80"></el-table-column>
                  <el-table-column prop="ACCEPTEMPLOYEE" label="接收人" width="80"></el-table-column>
                  <el-table-column prop="ACCEPTDATE" label="接收日期"></el-table-column>
                  </el-table-column>
                </el-table>
              </el-tab-pane>
            </el-tabs>
          </el-col>
          <el-col :span="12">
            <el-tabs v-model="tabfirst">
              <el-tab-pane label="小件信息" name="first" style="width: 100%;">
                <el-table border style="width: 100%" :data="partRecept.smallList" :height="490"
                  ref="partReceptsmallListRef">
                  <el-table-column type="selection" width="40"></el-table-column>
                  <el-table-column prop="PRODUCTNAME" label="件号" show-overflow-tooltip width="110"></el-table-column>
                  <el-table-column prop="DESCRIPTION" label="件号名称" show-overflow-tooltip></el-table-column>
                  <el-table-column prop="PRODUCTBATCHNO" label="批次" show-overflow-tooltip width="100"></el-table-column>
                  <el-table-column prop="SumQty" label="数量" width="70"></el-table-column>
                  <el-table-column prop="ASSEMBLEEMPLOYEE" label="配送人" width="80"></el-table-column>
                  <el-table-column prop="ACCEPTEMPLOYEE" label="接收人" width="80"></el-table-column>
                  <el-table-column prop="ACCEPTDATE" label="接收日期"></el-table-column>
                  </el-table-column>
                </el-table>
              </el-tab-pane>
            </el-tabs>
          </el-col>
        </el-row>
        <el-form :inline="true" style="margin-top: 10px;">
          <el-form-item label="卡号">
            <el-input v-model="partRecept.CardNum" @blur="querySearchAsync" placeholder="请输入卡号" />
          </el-form-item>
          <el-form-item label="姓名">
            <el-input disabled v-model="partRecept.fullname">
          </el-form-item>
        </el-form>
      </el-scrollbar>
      <template #footer>
        <span class="dialog-footer">
          <el-button type="success" @click="handlePartReceptSend">配送</el-button>
          <el-button type="warning" @click="handlePartReceptAccept">接收</el-button>
          <el-button @click="partRecept.partReceptDialogVisible = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>
    <!-- NC附件查看对话框 -->
    <el-dialog v-model="ncProgramViewDialogVisible" title="NC附件查看对话框" width="95%" :draggable="true" align-center>
      <el-card style="padding:10px;margin-top:10px;">
        <template #header>
          <div style="display: flex;align-items: center;position: relative;">
            <el-icon class="card-header-icon" style="font-size: 20px;">
              <info-filled />
            </el-icon>
            <span class="card-header-text">件号NC程序列表</span>
          </div>
        </template>
        <el-table @row-click="getNCProgramDetail" :row-class-name="tableRowClassName" :data="ncProgramDataList" border
          ref="ncProgramDataListRef" height="300">
          <el-table-column type="index" width="50"></el-table-column>
          <el-table-column prop="id" label="id" v-if="false"></el-table-column>
          <el-table-column prop="productname" label="零件图号"></el-table-column>
          <el-table-column prop="productdesc" label="零件名称"></el-table-column>
          <el-table-column prop="process_no" label="工艺规程编号"></el-table-column>
          <el-table-column prop="process_rev" label="工艺规程版本"></el-table-column>
          <el-table-column prop="specno" label="工序号"></el-table-column>
          <el-table-column prop="nc_name" label="NC程序名称"></el-table-column>
          <el-table-column prop="nc_no" label="NC程序版本"></el-table-column>
          <el-table-column prop="control_type" label="NC程序系统"></el-table-column>
        </el-table>
      </el-card>

      <el-row :gutter="10">
        <el-col :span="12">
          <el-card style="padding:10px;margin-top:10px;">
            <template #header>
              <div style="display: flex;align-items: center;position: relative;">
                <el-icon class="card-header-icon" style="font-size: 20px;">
                  <info-filled />
                </el-icon>
                <span class="card-header-text">设备清单</span>
              </div>
            </template>
            <el-table :data="ncProgarmResourcesList" stripe border height="200">
              <el-table-column type="index" width="50"></el-table-column>
              <el-table-column prop="id" label="id" v-if="false"></el-table-column>
              <el-table-column prop="equip_code" label="设备编号"></el-table-column>
              <el-table-column prop="equip_xh" label="设备型号"></el-table-column>
            </el-table>
          </el-card>
        </el-col>
        <el-col :span="12">
          <el-card style="padding:10px;margin-top:10px;">
            <template #header>
              <div style="display: flex;align-items: center;position: relative;">
                <el-icon class="card-header-icon" style="font-size: 20px;">
                  <info-filled />
                </el-icon>
                <span class="card-header-text">附件清单</span>
              </div>
            </template>
            <el-table :data="ncProgarmFilesList" stripe border height="200">
              <el-table-column type="index" width="50"></el-table-column>
              <el-table-column prop="id" label="id" v-if="false"></el-table-column>
              <el-table-column label="附件名称" prop="filename">
                <template #default="scope">
                  <el-link type="primary" @click="handleOpenDocumentClick(scope.row.filepath)">{{scope.row.filename}}
                  </el-link>
                </template>
              </el-table-column>
            </el-table>
          </el-card>
        </el-col>
      </el-row>
    </el-dialog>
  </div>

  <script type="module">
    const { createApp, reactive, ref, toRef, toRefs, onMounted, watch } = Vue
    const { ElMessage, ElLoading, ElMessageBox, ElNotification } = ElementPlus
    import { useFetch } from '../../../Scripts/hooks/useFetch.js';
    import { commonFetch } from '../../../Scripts/ZsJs/commonFetch.js';
    import { splitDate } from '../../../Scripts/utils/format.js';//时间截取
    import { usePageHeightSet } from '../../../Scripts/hooks/workreport/usePageHeightSet.js';//页面高度计算
    import { useGetUserInfo } from '../../../Scripts/hooks/useGetUserInfo.js';//获取账号信息
    import { getParams } from '../../../Scripts/utils/common.js';//获取页面参数
    import { useDocumentView } from '../../../Scripts/hooks/workreport/useDocumentView.js';//文档查看
    import { useNCProgramView } from '../../../Scripts/hooks/workreport/useNCProgramView.js';
    const App = {
      setup() {
        const baseAPI = '../../../Ashx/ContainerStepWorkReportVue3PageHandler.ashx';
        const ZSbaseAPI = '../../../Ashx/ZSHandler/ZSContainerStepWorkReportHandler.ashx';
        const FetchCommonUrl = '../../../Ashx/FetchCommonHandler.ashx';
        const lookProgressUrl = '../../../Ashx/ZsHandler/ZSIssueCollectMaterialHandler.ashx'//准备进度查看
        const sendRequestUrl = '../../../Ashx/ZsHandler/ZSSendRequestHandler.ashx'//发送配送提请
        const checkPointUrl = `http://${window.location.hostname}/InSiteWebApplication/forms/Custom/htmlPage/StepCheckPoint/CheckPointSymbolInput.aspx`

        let currentTime = ref('');// 当前时间

        // 页面布局高度配置
        const { clientHeight, inputHeight, tableHeight } = usePageHeightSet();
        const { userInfo, getUserInfo } = useGetUserInfo();

        let tabfirst = ref('first');// 选项卡当前选中索引
        const containerList = ref([]);
        const formData = reactive({
          ContainerNo: '',
          MachineStart: '',
          MachineEnd: '',
          BeginDate: '',
          EndDate: '',
          daterange: null
        });
        const currentContainerRow = ref(null);
        const specTableRef = ref(null)
        const stepTableRef = ref(null)
        const specList = ref([]);
        const containerTableRef = ref(null)
        const stepList = ref([])

        const worktimeInfo = reactive({ txtTimeAttribute: '0', txtSumWorkTime: '0', txtSumJX: '0' })//工时信息
        const lossReason = ref([])//超期原因结果集
        const lossReasonValue = ref(null)//超期原因
        const lossReasonNote = ref(null)//超期原因备注
        let currentSelectContainer = {}; // 任务单信息单选的批次

        //准备进度查看结果集
        let lookProgress = reactive({
          lookProgressDialogVisible: false,
          isLook: true,//true：进度看板，false:收料确认
          containerspecInfo: null,
          bigList: [],
          smallList: [],
          toolList: [],
          materialList: [],
          equList: []
        })

        // 文档查看
        const {
          documentViewDialogVisible,
          treeData,//文档查看Tree数据
          documentList,//文档查看文件清单
          getDocumentViewTreeData,
          getDocumentList,
          downloadFile,
        } = useDocumentView();

        //准备进度查看结果集
        let sendDeliveryApply = reactive({
          sendDeliveryApplyDialogVisible: false,
          bigsmallList: [],
          toolList: [],
          materialList: [],

        })
        const bigsmallListRef = ref(null)
        const toolListRef = ref(null)
        const materialListRef = ref(null)

        const bigLookListRef = ref(null)//去封table--ref
        const smallLookListRef = ref(null)//集件table--ref
        const toolLookListRef = ref(null)//工装工具table--ref
        const materialLookListRef = ref(null)//辅材table--ref

        //装配操作
        let IssueOperateInfo = reactive({
          workreportmaterialrecordid: "",
          PRODUCTNAME: '',
          PRODUCTBATCHNO: '',
          FIRSTASSEMBLEQTY: '',
          CONFIRMQTY: '',
          INQTY: 0,
          NOWQTY: 0,
          Reason: '0',
          Type: '0',
          Doc: '正常的工艺过程'
        })
        let IssueOperate = reactive({
          IssueOperateDialogVisible: false,
          specstepList: [],
          bigsmallList: [],
          IssueOperateList: [],
          IssueOperateRecordList: [],
          currentSpecStepInfo: null,
          currentBigSmallInfo: null,
          IssueOperateRecordInfo: null
        })

        //分解操作 
        let splitOperateInfo = reactive({
          NOWQTY: 0,
          Reason: '0',
          Doc: '正常的工艺过程'
        })
        let splitOperate = reactive({
          splitOperateDialogVisible: false,
          currentPage: 1,
          pageSize: 20,
          Total: 0,
          splitOperateList: []
        })
        //实测值录入
        const checkPoint = reactive({
          checkPointDialogVisible: false,
          Notes: null,
          containerList: [],
          checkPointList: [],
          checkPointResultList: [],
          currentcContainer: null,
          currentcheckPointRow: null,
          currentcheckPointResultRow: null,
          currentcheckPointRows: []
        });
        //质量问题查看
        const qualityLook = reactive({
          qualityLookDialogVisible: false,
          qualityLookList: [],
        })

        //零组件交换
        const partReceptbigListRef = ref(null)
        const partReceptsmallListRef = ref(null)
        const partRecept = reactive({
          partReceptDialogVisible: false,
          bigList: [],
          smallList: [],
          CardNum: null,
          fullname: null,
          employeeid: null
        })
        //左侧扫卡结果对象
        const containerSearchScan = reactive({
          notReportedList: [],//【待报工】数据
          unReportDataRows: 0,//【待报工】总数
          unCheckContainerData: [],//【待检验】数据
          unCheckContainerCount: 0,//【待检验】总数
        })

        // 刷新员工信息数据
        async function handleUserInfoFlushClick() {
          await getWorkTime();
        }
        // 2.查询工时------------------------------
        async function getWorkTime() {
          const config = {
            url: `${ZSbaseAPI}?action=getWorkTime`,
          };
          const { tdata, rdata } = await commonFetch(config);
          lossReason.value = tdata
          worktimeInfo.txtTimeAttribute = rdata.value.txtTimeAttribute
          worktimeInfo.txtSumWorkTime = rdata.value.txtSumWorkTime
          worktimeInfo.txtSumJX = rdata.value.txtSumJX
        }

        // 扫卡事件
        let searchObj = reactive({ containername: '' });
        async function handleContainerSearchBlur(type) {
          if (searchObj.containername || type === 1) {
            const config = {
              url: `${ZSbaseAPI}?action=getScanContainerData&searchText=${searchObj.containername}`
            };
            const { tdata, rdata } = await commonFetch(config);
            if (tdata.value != null) {
              containerSearchScan.notReportedList = tdata
              containerSearchScan.unReportDataRows = tdata.value.length
            } else {
              containerSearchScan.notReportedList = []
              containerSearchScan.unReportDataRows = 0
            }
            if (rdata.value != null) {
              containerSearchScan.unCheckContainerData = rdata
              containerSearchScan.unCheckContainerCount = rdata.value.length
            } else {
              containerSearchScan.unCheckContainerData = []
              containerSearchScan.unCheckContainerCount = 0
            }
          }
        }
        async function selectContainerMenu(val) {
          formData.ContainerNo = val.index
          await queryReportData()
        }
        //查询报工数据---------------------------
        async function queryReportData() {
          const requestData = Object.assign({}, formData);
          if (formData.daterange != null) {
            requestData.BeginDate = dayjs(formData.daterange[0]).format('YYYY-MM-DD')
            requestData.EndDate = dayjs(formData.daterange[1]).format('YYYY-MM-DD')
            requestData.daterange = ""
          }
          const config = {
            url: `${ZSbaseAPI}?action=getZSWorkReportContainerInfo&data=${JSON.stringify(requestData)}`,
          };

          const { tdata } = await commonFetch(config);
          containerList.value = tdata.value === null ? [] : Array.from(tdata.value);
          specList.value = [];
          currentSelectContainer = {}
        }
        //查询工序信息---------------------------------
        async function selectContainerRow(row, column, event) {
          const config = {
            url: `${ZSbaseAPI}?action=getWorkflowStep&data=${JSON.stringify(row)}`,
          };

          const { tdata } = await commonFetch(config);
          specList.value = tdata.value === null ? [] : Array.from(tdata.value);
          currentContainerRow.value = row//.CONTAINERID
          currentSelectContainer = { productid: row.PRODUCTID, workflowid: row.WORKFLOWID, productname: row.CONTAINERNO.split('-')[1] }
          specTableRef.value.toggleAllSelection();//默认全选
        }
        //查询工步信息-----------------------------------
        async function selectSpecChange(val) {
          if (val.length === 0) { stepList.value = []; return; }
          let specIDs = [];
          val.map(item => {
            specIDs.push({ WORKFLOWSTEPID: item.WORKFLOWSTEPID });
          });
          const config = {
            url: `${ZSbaseAPI}?action=getStepInfo&data=${JSON.stringify(specIDs)}&ContainerID=${currentContainerRow.value.CONTAINERID}`,
          };

          const { tdata } = await commonFetch(config);
          stepList.value = tdata.value === null ? [] : Array.from(tdata.value);
          stepTableRef.value.toggleAllSelection();//默认全选
        }
        //重置
        async function qureyReset() {
          formData.ContainerNo = '',
            formData.MachineStart = '',
            formData.MachineEnd = '',
            formData.BeginDate = '',
            formData.EndDate = '',
            formData.daterange = null
          await queryReportData()
        }

        // 日期字符串截取
        function dateFormatter(row, column, cellValue, index) {
          return cellValue && cellValue.includes('T') ? cellValue.split('T')[0] : cellValue;
        }

        // 1.【查看准备进度】按钮方法
        async function handleLookProgress() {
          const rows = specTableRef.value.getSelectionRows();
          if (rows.length != 1) {
            return ElMessage.error('请勾选一条工序信息再进行操作');
          }
          lookProgress.containerspecInfo = currentContainerRow
          lookProgress.containerspecInfo.WORKFLOWSTEPNAME = rows[0].WORKFLOWSTEPNAME
          lookProgress.lookProgressDialogVisible = true;
          lookProgress.isLook = true;
          let data = { id: rows[0].WORKFLOWSTEPID, containerno: currentContainerRow.value.CONTAINERNO, ContainerID: currentContainerRow.value.CONTAINERID, mfgorderid: currentContainerRow.value.MFGORDERID, type: '' }
          const config = {
            url: `${lookProgressUrl}?action=GetProgressData&id=${data.id}&containerno=${data.containerno}&ContainerID=${data.ContainerID}&type=&mfgorderid=${data.mfgorderid}`,
          };

          const { tdata, sdata, rdata, total, Message, Result } = await commonFetch(config);
          lookProgress.containerspecInfo = currentContainerRow
          lookProgress.bigList = sdata.value.bigTable
          lookProgress.smallList = sdata.value.smallTable
          lookProgress.toolList = sdata.value.toolTable
          lookProgress.materialList = sdata.value.auxMaterialTable
        }

        // 2.【工艺查看】按钮方法
        async function handleDocumentViewClick() {
          getDocumentViewTreeData({ currentSelectContainer, baseAPI });
        }

        // 2-1.【工艺查看】- 文档查看节点点击，查询工艺下的文档信息
        async function handleNodeClick(node) {
          const { id, type } = node;
          await getDocumentList({ url: `${baseAPI}`, method: 'getDocumentList', id, nodeType: type });
        }

        // 2-2.【工艺查看】- 打开文档
        async function handleOpenDocumentClick(filepath) {
          await downloadFile({ url: `${baseAPI}`, method: 'getDownloadUrl', filepath });
        }


        // 3.【任务接收】
        async function handleReceiveDispatch() {
          const rows = stepTableRef.value.getSelectionRows();
          if (rows.length === 0) {
            return ElMessage.error('请勾选至少一条工步信息再进行操作');
          }
          let DispatchIDs = []
          rows.map(item => { DispatchIDs.push("'" + item.CONTAINERSTEPDISPATCHID + "'") });
          const config = {
            url: `${ZSbaseAPI}?action=receiveDispatch&DispatchIDs=${DispatchIDs.join(',')}`,
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            await selectContainerRow(currentContainerRow.value, null, null)
          }
        }

        // 4.【发起配送提请】
        async function handleSendDeliveryApply() {
          const rows = specTableRef.value.getSelectionRows();
          if (rows.length === 0) {
            return ElMessage.error('请勾选至少一条工序信息再进行操作');
          }
          let specIDs = [];
          rows.map(item => {
            specIDs.push(item.WORKFLOWSTEPID);
          });
          sendDeliveryApply.sendDeliveryApplyDialogVisible = true;
          const config = {
            url: `${sendRequestUrl}?action=GetBigSmallData&id=${specIDs.join(',')}&ContainerNo=${currentContainerRow.value.CONTAINERNO}&ContainerID=${currentContainerRow.value.CONTAINERID}&mfgorderid=${currentContainerRow.value.MFGORDERID}`,
          };
          const { tdata, sdata, rdata, total, Message, Result } = await commonFetch(config);
          sendDeliveryApply.bigsmallList = tdata
          sendDeliveryApply.toolList = sdata.value.Table1
          sendDeliveryApply.materialList = rdata
        }
        //【大小件信息、工装工具信息、辅材信息】发送配送提请
        async function handleSendRequset(type) {
          let data = [];
          if (type === 1) {
            let rows = bigsmallListRef.value.getSelectionRows();
            rows.map(item => {
              if (item.STATUS == '未发送') {
                item.ApplyType = "1";
                item.PURPOSE = "";
                data.push(item);
              }
            });
          }
          let Aux = [];
          if (type === 2) {
            let rows = materialListRef.value.getSelectionRows();
            rows.map(item => {
              if (item.STATUS == '未发送') {
                Aux.push(item);
              }
            });
          }
          let Tools = []
          if (type === 3) {
            let rows = toolListRef.value.getSelectionRows();
            rows.map(item => {
              if (item.STATUS == '未发送') {
                Tools.push(item);
              }
            });
          }
          if ((data.length + Aux.length + Tools.length) === 0) {
            return ElMessage.error("工序所需" + (type == 1 ? "大小件" : (type == 2 ? "辅材" : "工装工具")) + "已全部发送提请");
          }
          const formData = new FormData();//C# 一般处理程序传参方式
          formData.append('ApplyType', "1");
          formData.append('ContainerNo', currentContainerRow.value.CONTAINERNO);
          formData.append('data', JSON.stringify(data));
          formData.append('Aux', JSON.stringify(Aux));
          formData.append('Tools', JSON.stringify(Tools));
          const config = {
            url: `${sendRequestUrl}?action=SendRequset`,
            data: formData
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            await handleSendDeliveryApply()
            await selectContainerRow(currentContainerRow.value, null, null)
          }

        }
        //5.【收料确认】
        async function handleReciveMaterialConfirm() {
          const rows = specTableRef.value.getSelectionRows();
          if (rows.length != 1) {
            return ElMessage.error('请勾选一条工序信息再进行操作');
          }
          lookProgress.containerspecInfo = currentContainerRow
          lookProgress.containerspecInfo.WORKFLOWSTEPNAME = rows[0].WORKFLOWSTEPNAME
          lookProgress.containerspecInfo.WORKFLOWSTEPID = rows[0].WORKFLOWSTEPID
          lookProgress.lookProgressDialogVisible = true;
          lookProgress.isLook = false;
          let data = { id: rows[0].WORKFLOWSTEPID, containerno: currentContainerRow.value.CONTAINERNO, ContainerID: currentContainerRow.value.CONTAINERID, mfgorderid: currentContainerRow.value.MFGORDERID, type: '' }
          const config = {
            url: `${sendRequestUrl}?action=GetBigSmallConfirmData&workflowstepid=${data.id}&containerno=${data.containerno}&ContainerID=${data.ContainerID}&type=&mfgorderid=${data.mfgorderid}`,
          };

          const { tdata, sdata, rdata, total, Message, Result } = await commonFetch(config);
          lookProgress.containerspecInfo = currentContainerRow
          lookProgress.bigList = tdata
          lookProgress.smallList = rdata
          lookProgress.toolList = sdata.value.Table2
          lookProgress.materialList = sdata.value.Table1
        }
        //5.1 【去封、集件】大小件收料确认
        async function handleReceiveBigSmall(type) {
          let rows = lookProgress.bigList;
          if (type === 1) {
            rows = lookProgress.smallList;
          }
          var data = [];
          rows.map(item => {
            if (Number(item.NNORECEIVEQTY) > 0) {
              data.push(item);
            }
          });
          if (data.length === 0) { return ElMessage.error(`工序所需${type === 1 ? '小件' : '大件'}已收料完`); }
          const formData = new FormData();
          formData.append('data', JSON.stringify(data));
          formData.append('workflowstepid', lookProgress.containerspecInfo.WORKFLOWSTEPID);
          formData.append('ContainerID', currentContainerRow.value.CONTAINERID);
          formData.append('ContainerNo', currentContainerRow.value.CONTAINERNO);
          const config = {
            url: `${sendRequestUrl}?action=ReceiveConfirmBigSmall`,
            data: formData
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            await handleReciveMaterialConfirm()
            await selectContainerRow(currentContainerRow.value, null, null)
          }
        }

        //5.2 【工装工具、辅材】收料确认
        async function handleRTReceive(type) {
          let rows = lookProgress.toolList;
          if (type === 2) {
            rows = lookProgress.materialList;
          }
          var data = [];
          rows.map(item => {
            if (Number(item.NNORECEIVEQTY) > 0) {
              data.push(item);
            }
          });
          if (data.length === 0) { return ElMessage.error(`工序所需${type === 1 ? '工装工具' : '辅材'}已收料完`); }
          const formData = new FormData();
          formData.append('data', JSON.stringify(data));
          formData.append('TransportType', type);
          formData.append('workflowstepid', lookProgress.containerspecInfo.WORKFLOWSTEPID);
          formData.append('ContainerID', currentContainerRow.value.CONTAINERID);
          formData.append('ContainerNo', currentContainerRow.value.CONTAINERNO);
          const config = {
            url: `${sendRequestUrl}?action=ReceiveToolsTransport`,
            data: formData
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            await handleReciveMaterialConfirm()
            await selectContainerRow(currentContainerRow.value, null, null)
          }
        }

        //6.【任务单工序开工】
        async function handleWorkflowstepOpenWork() {
          const rows = specTableRef.value.getSelectionRows();
          if (rows.length === 0) {
            return ElMessage.error('请勾选至少一条工序信息再进行操作');
          }
          let data = { ContainerID: currentContainerRow.value.CONTAINERID, ContainerNo: currentContainerRow.value.CONTAINERNO }
          let specIDs = [];
          rows.map(item => {
            specIDs.push({ WORKFLOWSTEPID: item.WORKFLOWSTEPID, STATUS: item.STATUS });
          });
          const config = {
            url: `${ZSbaseAPI}?action=containerWorkflowstepOpenWork&data=${JSON.stringify(data)}&dt=${JSON.stringify(specIDs)}`,
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            await selectContainerRow(currentContainerRow.value, null, null)
          }
        }
        //7.【装配操作】
        async function handlePuplIssueOperate() {
          IssueOperate.IssueOperateDialogVisible = true
          IssueOperate.currentSpecStepInfo = null
          IssueOperate.currentBigSmallInfo = null
          IssueOperate.IssueOperateRecordInfo = null
          IssueOperate.bigsmallList = []
          IssueOperate.IssueOperateList = []
          IssueOperate.IssueOperateRecordList = []
          let mrow = currentContainerRow.value;
          if (mrow === null) {
            return ElMessage.error('请选择报工任务单');
          }
          let steprows = stepTableRef.value.getSelectionRows();
          let wsrows = specTableRef.value.getSelectionRows();
          let workflowstep = [];
          let str = "";
          wsrows.map(item => {
            if (item.STATUS != "装配中") {
              str += item.STATUS;
              workflowstep.push(item.WORKFLOWSTEPNAME);
            }
          });
          if (str != "") {
            return ElMessage.error('所选择的工序记录含有非【装配中】的记录，不能进行装配');
          }
          var steprowsID = [];
          steprows.map(item => {
            if (item.STEPINFOID != null && item.STEPINFOID != '') {
              steprowsID.push("'" + item.STEPINFOID + "'");
            }
          });
          const data = { ContainerID: mrow.CONTAINERID, WorkflowID: mrow.WORKFLOWID }
          if (steprowsID.length > 0) {
            data.StepInfoIDs = steprowsID.join(',')
          }
          const formData = new FormData();
          formData.append('data', JSON.stringify(data));
          const config = {
            url: `${ZSbaseAPI}?action=getStepInfoList`,
            data: formData
          };
          const { tdata } = await commonFetch(config);
          IssueOperate.specstepList = tdata
        }
        //7.1【装配操作】--查询大小件信息
        async function selectSpecBigSmall(row, column, event) {
          IssueOperate.currentSpecStepInfo = row///当前选择的工序工步行
          let data = { ContainerID: currentContainerRow.value.CONTAINERID, workflowstepid: row.WORKFLOWSTEPID, StepInfoId: row.STEPINFOID }
          const formData = new FormData();
          formData.append('data', JSON.stringify(data));
          const config = {
            url: `${ZSbaseAPI}?action=getIssueConfirmData`,
            data: formData
          };
          const { tdata } = await commonFetch(config);
          IssueOperate.bigsmallList = tdata

        }
        //7.2 【装配操作】--查询大小件装配记录信息
        async function selectIssueBigSmall(row, column, event) {
          let data = { containerid: currentContainerRow.value.CONTAINERID, workflowstepid: IssueOperate.currentSpecStepInfo.WORKFLOWSTEPID, productname: row.PRODUCTNAME, issueerpmaterialid: row.ISSUEERPMATERIALID }
          const formData = new FormData();
          formData.append('data', JSON.stringify(data));
          const config = {
            url: `${ZSbaseAPI}?action=getWorkreportmaterialrecord`,
            data: formData
          };
          const { sdata, rdata } = await commonFetch(config);
          IssueOperate.IssueOperateList = sdata.value.Collect
          IssueOperate.IssueOperateRecordList = sdata.value.Child
          IssueOperateInfo = Object.assign(IssueOperateInfo, row)
          IssueOperateInfo.INQTY = rdata
          IssueOperate.currentBigSmallInfo = row//当前选择的大小件行
          IssueOperateInfo.workreportmaterialrecordid = ""
        }
        //7.3【装配操作】--保存大小件装配记录信息()
        async function saveIssueOperateRecord() {
          if (IssueOperate.currentSpecStepInfo == null) {
            return ElMessage.error('请先选择工步工序');
          }
          if (IssueOperate.currentBigSmallInfo == null) {
            return ElMessage.error('请先选择要装入的批次');
          }
          if (Number(IssueOperateInfo.INQTY) + Number(IssueOperateInfo.NOWQTY) > Number(IssueOperateInfo.FIRSTASSEMBLEQTY)) {
            return ElMessage.error('装入总数量不能大于单台数量');
          }
          if (Number(IssueOperateInfo.INQTY) + Number(IssueOperateInfo.NOWQTY) > Number(IssueOperateInfo.CONFIRMQTY)) {
            return ElMessage.error('装入总数量不能大于确认数量');
          }
          let IsFinish = Number(IssueOperateInfo.INQTY) + Number(IssueOperateInfo.NOWQTY) >= Number(IssueOperateInfo.CONFIRMQTY) ? "1" : ""
          IssueOperateInfo.IsFinish = IsFinish
          IssueOperateInfo.ContainerId = currentContainerRow.value.CONTAINERID
          IssueOperateInfo.WorkflowStepID = IssueOperate.currentSpecStepInfo.WORKFLOWSTEPID
          IssueOperateInfo.StepInfoID = IssueOperate.currentSpecStepInfo.STEPINFOID
          console.info(IssueOperateInfo)
          const config = {
            url: `${ZSbaseAPI}?action=insertWorkReportMaterialRecord&data=${JSON.stringify(IssueOperateInfo)}`,
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            await selectIssueBigSmall(IssueOperate.currentBigSmallInfo, null, null)
          }
        }
        //7.4 【装配操作】--单选装配记录信息
        async function selectIssueOperateRecord(row, column, event) {
          IssueOperateInfo.NOWQTY = row.QTY
          IssueOperateInfo.workreportmaterialrecordid = row.WORKREPORTMATERIALRECORDID
        }
        //7.5 【装配操作】--删除大小件装配记录信息()
        async function deleteIssueOperateRecord() {
          if (IssueOperateInfo.workreportmaterialrecordid == "") {
            return ElMessage.error('请选择需要删除的装配记录');
          }
          const config = {
            url: `${ZSbaseAPI}?action=deleteWorkReportMaterialRecord&workreportmaterialrecordid=${IssueOperateInfo.workreportmaterialrecordid}`,
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            IssueOperateInfo.workreportmaterialrecordid = ""
            await selectIssueBigSmall(IssueOperate.currentBigSmallInfo, null, null)
          }
        }
        //8.【分解操作】
        async function handlePupSplitOperate() {
          splitOperate.splitOperateDialogVisible = true
          splitOperateInfo = null
          await getWRSplitmaterialrecord()
        }
        //8.1 【分解操作】---获取装配记录信息
        async function getWRSplitmaterialrecord() {
          const formData = new FormData();
          formData.append('data', JSON.stringify({ ContainerID: currentContainerRow.value.CONTAINERID, PageSize: splitOperate.pageSize, CurrentPageIndex: splitOperate.currentPage }));
          const config = {
            url: `${ZSbaseAPI}?action=getWRSplitmaterialrecord`,
            data: formData
          };
          const { tdata, total } = await commonFetch(config);
          splitOperate.splitOperateList = tdata
          splitOperate.Total = Number(total.value)
        }
        //8.2【分解操作】---页数变化
        async function handleSizeChange(pageSize) {
          splitOperate.pageSize = pageSize
          await getWRSplitmaterialrecord()
        }
        //8.3【分解操作】---页数变化
        async function handleCurrentChange(currentPage) {
          splitOperate.currentPage = currentPage
          await getWRSplitmaterialrecord()
        }
        //8.4【分解操作】---分解记录行点击
        async function selectsplitOperateRecord(row, column, event) {
          splitOperateInfo = Object.assign(splitOperateInfo, row)
        }
        //8.5 【分解操作】---保存装配记录信息
        async function savesplitOperateRecord() {
          if (splitOperateInfo.WORKREPORTMATERIALRECORDID == null || splitOperateInfo.WORKREPORTMATERIALRECORDID === undefined) {
            return ElMessage.error('请先选择要分解的装配记录');
          }
          splitOperateInfo.ContainerID = currentContainerRow.value.CONTAINERID
          if (Number(splitOperateInfo.NOWQTY) == 0) {
            return ElMessage.error('分解数量不能小于0');
          }
          const config = {
            url: `${ZSbaseAPI}?action=insertSplitReportRecord&data=${JSON.stringify(splitOperateInfo)}`,
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            splitOperateInfo.WORKREPORTMATERIALRECORDID = null
            await getWRSplitmaterialrecord()
          }
        }

        //9.【实测值录入】
        const checkPointTableRef = ref(null)
        async function handlePupInputChechPoint() {
          let mrow = currentContainerRow.value;
          let wsrows = specTableRef.value.getSelectionRows();
          let steprows = stepTableRef.value.getSelectionRows();
          if (wsrows.length === 0) {
            return ElMessage.error('请勾选工序再进行操作');
          }
          checkPoint.checkPointDialogVisible = true
          const formData = new FormData();
          formData.append('mdata', JSON.stringify({ ContainerID: mrow.CONTAINERID, ContainerName: mrow.CONTAINERNAME, Machine: mrow.MACHINENAME }));
          formData.append('data', JSON.stringify(steprows));
          const config = {
            url: `${ZSbaseAPI}?action=pupInputChechPoint`,
            data: formData
          };
          const { tdata } = await commonFetch(config);
          checkPoint.containerList = tdata
          checkPoint.checkPointList = []
          checkPoint.checkPointResultList = []
        }
        //9.1【实测值录入】---批次工序选择
        async function selectContainer(row, column, event) {
          const formData = new FormData();
          formData.append('data', JSON.stringify({ ContainerID: row.ContainerId, ProductID: row.ProductId, StepID: row.WorkFlowStepId, StepinfoID: row.StepinfoId }));
          const config = {
            url: `${ZSbaseAPI}?action=getStepCheckPointList`,
            data: formData
          };
          const { tdata, rdata } = await commonFetch(config);
          checkPoint.checkPointList = tdata
          checkPoint.currentcContainer = row
          checkPoint.checkPointResultList = []
        }
        //9.2【实测值录入】---检测项选择查询检测结果
        async function selectcheckPointRow(row, column, event) {
          checkPoint.currentcheckPointRow = row
          checkPointTableRef.value.clearSelection();//取消多选
          checkPoint.currentcheckPointRows = [];
          const formData = new FormData();
          formData.append('data', JSON.stringify({ ContainerID: checkPoint.currentcContainer.ContainerId, ProductID: checkPoint.currentcContainer.ProductId, StepID: checkPoint.currentcContainer.WorkFlowStepId, StepCheckPointID: row.STEPCHECKPOINTID }));
          const config = {
            url: `${ZSbaseAPI}?action=getStepCheckPointResultList`,
            data: formData
          };
          const { tdata, rdata } = await commonFetch(config);
          checkPoint.checkPointResultList = rdata
        }
        //9.2【实测值录入】---检测结果行点击
        async function selectcheckPointResultRow(row, column, event) {
          checkPoint.currentcheckPointResultRow = row

        }
        //9.3 【实测值录入】---保存
        async function saveCheckPointResult() {
          if (checkPoint.currentcheckPointRow === null && checkPoint.currentcheckPointRows.length === 0) {
            return ElMessage.error('请选择检测项再进行操作');
          }
          var strCode = document.getElementById("pointContent").contentDocument.getElementById("wucToleranceInput1_ftbFinalHtml_designEditor").contentDocument.body.innerHTML;
          if (strCode == "") {
            return ElMessage.error('实测值录入不能为空');
          }
          if (checkPoint.currentcheckPointRow !== null) {
            if (Number(checkPoint.currentcheckPointRow.INPUTNUM) > checkPoint.checkPointResultList.length) {
              checkPoint.checkPointResultList.push({ WORKCHECKPOINTRESULTNOTE: strCode, WORKER: userInfo.value.employeename, STEPCHECKPOINTRESULTID: checkPoint.checkPointResultList.length, NOTES: checkPoint.Notes, INPUTNUM: checkPoint.currentcheckPointRow.INPUTNUM, StepCheckPointID: checkPoint.currentcheckPointRow.STEPCHECKPOINTID })
            } else {
              if (checkPoint.checkPointResultList.length > 0 && checkPoint.currentcheckPointResultRow === null) {
                return ElMessage.error('请选择已录入检测项结果再进行操作');
              } else {
                checkPoint.checkPointResultList.map(item => {
                  if (item.STEPCHECKPOINTRESULTID === checkPoint.currentcheckPointResultRow.STEPCHECKPOINTRESULTID) {
                    item.WORKCHECKPOINTRESULTNOTE = strCode
                    item.NOTES = checkPoint.Notes
                  }
                });
              }
            }
          } else {
            checkPoint.currentcheckPointRows.forEach((item, index) => {
              if (Number(item.INPUTNUM) > item.AINPUTNUM) {
                checkPoint.checkPointResultList.push({ WORKCHECKPOINTRESULTNOTE: strCode, WORKER: userInfo.value.employeename, STEPCHECKPOINTRESULTID: item.AINPUTNUM, NOTES: checkPoint.Notes, INPUTNUM: item.INPUTNUM, StepCheckPointID: item.STEPCHECKPOINTID })
              } else {
                checkPoint.checkPointResultList.map(itemm => {
                  if (itemm.STEPCHECKPOINTID === item.STEPCHECKPOINTID) {
                    itemm.WORKCHECKPOINTRESULTNOTE = strCode
                    itemm.NOTES = checkPoint.Notes
                  }
                });
              }
            });
          }
          let formData = new FormData();
          formData.append("ContainerID", currentContainerRow.value.CONTAINERID)
          ///formData.append("StepCheckPointID", checkPoint.currentcheckPointRow.STEPCHECKPOINTID)
          ///formData.append("INPUTNUM", checkPoint.currentcheckPointRow.INPUTNUM)
          formData.append("data", JSON.stringify(checkPoint.checkPointResultList))
          const config = {
            url: `${ZSbaseAPI}?action=saveCheckPointResult`,
            data: formData
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            document.getElementById("pointContent").contentDocument.getElementById("wucToleranceInput1_ftbFinalHtml_designEditor").contentDocument.body.innerHTML = ""
            checkPoint.Notes = null
            if (checkPoint.currentcheckPointRow !== null) {
              await selectcheckPointRow(checkPoint.currentcheckPointRow, null, null)
            } else {
              await handleSelectionCheckPointChange(checkPoint.currentcheckPointRows);
            }
          }
        }
        //9.4【实测值录入】---检测项多选查询检测结果
        async function handleSelectionCheckPointChange(rows) {
          checkPoint.currentcheckPointRows = rows;
          if (rows.length > 0) {
            checkPointTableRef.value.setCurrentRow();//取消单选
            checkPoint.currentcheckPointRow = null;
          }
          const STEPCHECKPOINTIDs = rows.map(item => item.STEPCHECKPOINTID).join(',');
          const formData = new FormData();
          formData.append('data', JSON.stringify({ ContainerID: checkPoint.currentcContainer.ContainerId, ProductID: checkPoint.currentcContainer.ProductId, StepID: checkPoint.currentcContainer.WorkFlowStepId, StepCheckPointID: STEPCHECKPOINTIDs }));
          const config = {
            url: `${ZSbaseAPI}?action=getStepCheckPointResultList`,
            data: formData
          };
          const { tdata, rdata } = await commonFetch(config);
          checkPoint.checkPointResultList = rdata
          checkPoint.checkPointList.map(item => {
            const exist = checkPoint.checkPointResultList.some(itemm => itemm.STEPCHECKPOINTID === item.STEPCHECKPOINTID)
            if (exist) { item.STATUS = "已录"; }
          })
        }

        //10.【问题快反】
        async function handleMESFeedbackClick() {
          if (currentContainerRow.value != null) {
            var data = { createuser: 'MES_' + userInfo.value.employeename, containerid: currentContainerRow.value.CONTAINERID };
            const config = {
              url: `${ZSbaseAPI}?action=saveBpmContainerInfo&data=${JSON.stringify(data)}`,
            };
            const { Result } = await commonFetch(config);
            if (Result) {
              window.open('http://10.15.7.194:8088/portal/ssologin_mes_feedback_new.jsp?iv-user=' + userInfo.value.employeename);
            }
          } else {
            window.open('http://10.15.7.194:8088/portal/ssologin_mes_feedback_new.jsp?iv-user=' + userInfo.value.employeename);
          }
        }
        //11.【质量问题查看】
        async function handleQualityProblemLook() {
          let mrow = currentContainerRow.value;
          if (mrow === null) {
            return ElMessage.error('请选择任务单再进行操作');
          }
          qualityLook.qualityLookDialogVisible = true;
          const config = {
            url: `${ZSbaseAPI}?action=getQualityHistoryRecord&data=${JSON.stringify({ productname: mrow.MACHINENAME })}`,
          };
          const { tdata } = await commonFetch(config);
          qualityLook.qualityLookList = tdata
        }
        //12.【零组件交换】
        async function handlePupPartRecept() {
          let mrow = currentContainerRow.value;
          if (mrow === null) {
            return ElMessage.error('请选择任务单再进行操作');
          }
          partRecept.partReceptDialogVisible = true
          const config = {
            url: `${ZSbaseAPI}?action=getIssueMenuInfoDS&data=${JSON.stringify({ ContainerNo: mrow.CONTAINERNO, ContainerId: mrow.CONTAINERID, mfgorderId: mrow.MFGORDERID })}`,
          };
          const { tdata, rdata } = await commonFetch(config);
          partRecept.bigList = tdata
          partRecept.smallList = rdata
        }
        //12.1【零组件交换】--配送
        async function handlePartReceptSend() {
          let bigRows = partReceptbigListRef.value.getSelectionRows()
          let smallRows = partReceptsmallListRef.value.getSelectionRows();
          if (bigRows.length + smallRows.length === 0) {
            return ElMessage.error('请勾选零组件');
          }
          if (partRecept.employeeid === null) {
            return ElMessage.error('请先输入配送人信息');
          }
          let formData = new FormData();
          formData.append("bigsmall", JSON.stringify([...bigRows, ...smallRows]))
          formData.append("employeeid", partRecept.employeeid);
          const config = {
            url: `${ZSbaseAPI}?action=partReceptSend`,
            data: formData
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            await handlePupPartRecept()
          }
        }
        //12.1 【零组件交换】--配送人查询
        async function querySearchAsync() {
          if (partRecept.CardNum === null) {
            return;
          }
          const config = {
            url: `${ZSbaseAPI}?action=getEmployeeByDic&data=${JSON.stringify({ CardNum: partRecept.CardNum })}`,
          };
          const { tdata } = await commonFetch(config);
          if (tdata.value.length > 0) {
            partRecept.CardNum = tdata.value[0].CARDNUM
            partRecept.fullname = tdata.value[0].FULLNAME
            partRecept.employeeid = tdata.value[0].EMPLOYEEID
          } else {
            partRecept.fullname = null
            partRecept.employeeid = null
            return ElMessage.error('根据卡号信息查询不到相关人员');
          }
        }
        //12.2【零组件交换】--接收
        async function handlePartReceptAccept() {
          let bigRows = partReceptbigListRef.value.getSelectionRows()
          let smallRows = partReceptsmallListRef.value.getSelectionRows();
          if (bigRows.length + smallRows.length === 0) {
            return ElMessage.error('请勾选零组件');
          }

          let formData = new FormData();
          formData.append("bigsmall", JSON.stringify([...bigRows, ...smallRows]))
          const config = {
            url: `${ZSbaseAPI}?action=partReceptAccept`,
            data: formData
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            await handlePupPartRecept()
          }
        }

        //13.报工操作
        async function handleContainerStepWorkReport() {
          let mrow = currentContainerRow.value;
          if (mrow === null) {
            return ElMessage.error('请选择报工任务单');
          }
          let steprows = stepTableRef.value.getSelectionRows();
          if (steprows.length === 0) {
            return ElMessage.error('请选择要报工的工序工步记录');
          }
          let wsrows = specTableRef.value.getSelectionRows();
          let workflowstep = [];
          let str = "";
          wsrows.map(item => {
            if (item.STATUS != "装配中") {
              str += item.STATUS;
              workflowstep.push(item.WORKFLOWSTEPNAME);
            }
          });
          if (str != "") {
            return ElMessage.error('报工工步对应工序【' + workflowstep.join(',') + '】未开工，不能进行报工');
          }
          mrow.ddlReasonType = lossReasonValue.value
          mrow.txtReason = lossReasonNote.value

          const formData = new FormData();
          formData.append('data', JSON.stringify(mrow));
          formData.append('wgStepInfo', JSON.stringify(steprows));
          const config = {
            url: `${ZSbaseAPI}?action=addContainerStepWorkReportInfo`,
            data: formData
          };
          const { Message, Result } = await commonFetch(config);
          if (Result) {
            ElMessage.success(Message)
            await selectContainerRow(currentContainerRow.value, null, null)
            await handleContainerSearchBlur(1)
            lossReasonValue.value = null
            lossReasonNote.value = null
          }
        }
        // NC附件查看
        const {
          ncProgramViewDialogVisible,
          ncProgramDataList,//数控程序清单
          getNCProgramData,
          getNCProgramDetail,
          tableRowClassName,
          ncProgarmResourcesList,//设备清单
          ncProgarmFilesList,//附件清单
        } = useNCProgramView();
        // NC程序附件查看
        async function handleNCProgramViewClick() {
          getNCProgramData({ currentSelectContainer, baseAPI });
        }
        // 页面声明周期钩子
        onMounted(async () => {

          let incrementNumber = () => {
            setTimeout(incrementNumber, 3000);
            currentTime.value = dayjs().format('YYYY年MM月DD日  HH:mm');
          }

          setTimeout(incrementNumber, 0);

          // 查询当前用户信息，绑定给响应式变量 userInfo
          const uid = Decrypt(getParams('uid'));
          await getUserInfo({ url: `${FetchCommonUrl}`, method: 'getUserInfo', employeeid: uid });

          // 用户并不存在
          if (!userInfo.value.employeeid) {
            return ElNotification({ title: '错误', message: '用户不存在', type: 'error', duration: 0, });
          }

          const { factorycode, factoryid, employeeid } = userInfo.value;

          //装配厂
          const allowedFacotrys = ['603'];
          if (allowedFacotrys.filter(i => i === factorycode).length === 0) {
            return ElNotification({ title: '错误', message: '当前分厂暂不能使用该功能', type: 'error', duration: 0, });
          }
          //查询工时
          await getWorkTime();
          await handleContainerSearchBlur(1);
        })

        // 返回给页面使用的数据
        return {
          currentTime,//当前时间
          tabfirst,
          clientHeight, inputHeight, tableHeight,
          formData,
          containerTableRef,
          queryReportData,//查询报工数据(方法)
          containerList,//查询报工数据
          selectContainerRow,//任务单表格行点击事件（查询工序数据）
          currentContainerRow,
          specTableRef,
          stepTableRef,
          specList,//工序数据
          selectSpecChange,//工序勾选变动事件（查询工步信息）
          stepList,//工步数据

          worktimeInfo,//工时信息
          getWorkTime,//查询工时
          lossReason,
          lossReasonValue,
          lossReasonNote,
          handleLookProgress,//【查看准备进度】按钮方法
          lookProgress,//查看准备进度对象集

          handleNodeClick,//【文档查看】- 文档查看节点点击
          handleOpenDocumentClick,//【文档查看】-【查看文档】按钮点击
          documentViewDialogVisible,//文档查看弹出框
          treeData,//文档查看Tree数据
          documentList,//文档查看文件清单

          sendDeliveryApply,//发送配送提请对象集
          bigsmallListRef,//大小件信息表格唯一ref
          toolListRef,//工装工具信息表格唯一ref
          materialListRef,//辅材信息表格唯一ref

          bigLookListRef,//去封table--ref
          smallLookListRef,//集件table--ref
          toolLookListRef,//工装工具table--ref
          materialLookListRef,//辅材table--ref

          IssueOperate,//装配操作
          IssueOperateInfo,//装配操作明细
          splitOperate,//分解操作
          splitOperateInfo,//分解操作明细
          handleSizeChange,//分解页数变化
          handleCurrentChange,//分解分页变化
          checkPoint,//实测值录入
          checkPointUrl,//检测项录入引用URL
          qualityLook,//质量问题查看
          partRecept,//零组件交换
          partReceptbigListRef,//零组件交换大件Ref
          partReceptsmallListRef,//零组件交换小件Ref


          handleReceiveDispatch,//【任务接收】按钮点击
          handleSendDeliveryApply,//【发起配送提请】按钮点击
          handleSendRequset,//弹出框【发起配送提请】按钮点击
          handleReciveMaterialConfirm,// 【收料确认】按钮点击
          handleReceiveBigSmall,//【收料确认--去封、集件】按钮点击
          handleRTReceive,//【收料确认--工装工具、辅材】按钮点击
          handleWorkflowstepOpenWork,// 【任务单工序开工】按钮点击
          handlePuplIssueOperate,// 【装配操作】按钮点击
          selectSpecBigSmall,//【装配操作】--查询大小件信息
          selectIssueBigSmall,//【装配操作】--查询大小件装配记录信息
          saveIssueOperateRecord,//【装配操作】--保存大小件装配记录信息
          deleteIssueOperateRecord,//【装配操作】--删除大小件装配记录信息
          selectIssueOperateRecord,//【装配操作】--单选大小件装配记录信息
          handlePupSplitOperate,// 【分解操作】按钮点击
          selectsplitOperateRecord,//【分解操作】单选行点击
          savesplitOperateRecord,//【分解操作】保存分解记录
          handlePupInputChechPoint,// 【实测值录入】按钮点击
          selectContainer,//【实测值录入】查询实测值及其录入结果
          selectcheckPointRow,//【实测值录入】实测值单选行事件
          selectcheckPointResultRow,//【实测值录入】实测值单选行事件
          saveCheckPointResult,//【实测值录入】保存按钮点击
          handleQualityProblemLook,//【质量问题查看】按钮点击
          handlePupPartRecept,//【零组件交换】按钮点击
          handlePartReceptSend,//【零组件交换】配送人按钮点击
          handlePartReceptAccept,//【零组件交换】接收按钮点击
          querySearchAsync,//【零组件交换】查询配送人
          handleContainerStepWorkReport,//【报工】按钮点击
          handleSelectionCheckPointChange,//【实测值录入】实测值多选行事件
          checkPointTableRef,//检测项表格唯一ref
          splitDate,
          dateFormatter,
          userInfo,//当前用户信息
          searchObj,
          containerSearchScan,//扫卡查询【待报工、待检验】数据对象
          handleDocumentViewClick,//【文档查看】按钮点击
          handleMESFeedbackClick,// 问题快反
          handleUserInfoFlushClick,//刷新员工信息数据
          handleContainerSearchBlur,
          selectContainerMenu,
          qureyReset,
          handleNCProgramViewClick,//NC程序附件查看
          ncProgramViewDialogVisible,
          ncProgramDataList,//数控程序清单
          ncProgarmResourcesList,//设备清单
          ncProgarmFilesList,//附件清单
          getNCProgramDetail
        }
      }
    };
    const app = createApp(App);
    app.use(ElementPlus, {
      locale: ElementPlusLocaleZhCn,
      //size: 'normal'
    });
    // 注册所有icon
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      switch (key) {
        case "View":
          app.component('icon-view', component)
          break;
        case "Menu":
          app.component('icon-menu', component)
          break;
        default:
          app.component(key, component)
          break;
      }
    }

    app.mount('#app');
  </script>
</body>

</html>